#include "StdAfx.h"
#include "GResLoad.h"
#include "../Image/SOIL.h"

GLuint GImageLoad::LoadTextureFromFile(const wchar_t* fileName)
{
	GLuint texture = 0;
	texture = SOIL_load_OGL_texture
		(
		conversion::wstr2astr(fileName).c_str(),
		SOIL_LOAD_AUTO,
		SOIL_CREATE_NEW_ID,
		SOIL_FLAG_MIPMAPS | SOIL_FLAG_INVERT_Y
		);
	if (texture ==0)
	{
		assert(0);
	}
	return texture;
}

